
package gov.chinatax.ctcps.generator.form;

import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for syTz.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="syTzForm"
 */
public class SyTzForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _tzbh = null;
   private java.lang.String _tzbt = null;
   private java.lang.String _tznr = null;
   private java.lang.String _tzlxDm = null;
   private java.lang.String _dwbh = null;
   private java.lang.String _tzfj = null;
   private java.lang.String _bjrq = null;
   private java.lang.String _xtzBz = null;
   private java.lang.String _jjtzBz = null;
   private java.lang.String _sx = null;
   private java.lang.String _zt1 = null;
   private java.lang.String _zt2 = null;

   /**
    * Standard constructor.
    */
   public SyTzForm() {
   }

   /**
    * Returns the tzbh
    *
    * @return the tzbh
    */
   public java.lang.String getTzbh() {
      return _tzbh;
   }

   /**
    * Sets the tzbh
    *
    * @param tzbh the new tzbh value
    */
   public void setTzbh(java.lang.String tzbh) {
      _tzbh = tzbh;
   }
   /**
    * Returns the tzbt
    *
    * @return the tzbt
    */
   public java.lang.String getTzbt() {
      return _tzbt;
   }

   /**
    * Sets the tzbt
    *
    * @param tzbt the new tzbt value
    */
   public void setTzbt(java.lang.String tzbt) {
      _tzbt = tzbt;
   }
   /**
    * Returns the tznr
    *
    * @return the tznr
    */
   public java.lang.String getTznr() {
      return _tznr;
   }

   /**
    * Sets the tznr
    *
    * @param tznr the new tznr value
    */
   public void setTznr(java.lang.String tznr) {
      _tznr = tznr;
   }
   /**
    * Returns the tzlxDm
    *
    * @return the tzlxDm
    */
   public java.lang.String getTzlxDm() {
      return _tzlxDm;
   }

   /**
    * Sets the tzlxDm
    *
    * @param tzlxDm the new tzlxDm value
    */
   public void setTzlxDm(java.lang.String tzlxDm) {
      _tzlxDm = tzlxDm;
   }
   /**
    * Returns the dwbh
    *
    * @return the dwbh
    */
   public java.lang.String getDwbh() {
      return _dwbh;
   }

   /**
    * Sets the dwbh
    *
    * @param dwbh the new dwbh value
    */
   public void setDwbh(java.lang.String dwbh) {
      _dwbh = dwbh;
   }
   /**
    * Returns the tzfj
    *
    * @return the tzfj
    */
   public java.lang.String getTzfj() {
      return _tzfj;
   }

   /**
    * Sets the tzfj
    *
    * @param tzfj the new tzfj value
    */
   public void setTzfj(java.lang.String tzfj) {
      _tzfj = tzfj;
   }
   /**
    * Returns the bjrq
    *
    * @return the bjrq
    */
   public java.lang.String getBjrq() {
      return _bjrq;
   }

   /**
    * Sets the bjrq
    *
    * @param bjrq the new bjrq value
    */
   public void setBjrq(java.lang.String bjrq) {
      _bjrq = bjrq;
   }
   /**
    * Returns the xtzBz
    *
    * @return the xtzBz
    */
   public java.lang.String getXtzBz() {
      return _xtzBz;
   }

   /**
    * Sets the xtzBz
    *
    * @param xtzBz the new xtzBz value
    */
   public void setXtzBz(java.lang.String xtzBz) {
      _xtzBz = xtzBz;
   }
   /**
    * Returns the jjtzBz
    *
    * @return the jjtzBz
    */
   public java.lang.String getJjtzBz() {
      return _jjtzBz;
   }

   /**
    * Sets the jjtzBz
    *
    * @param jjtzBz the new jjtzBz value
    */
   public void setJjtzBz(java.lang.String jjtzBz) {
      _jjtzBz = jjtzBz;
   }
   /**
    * Returns the sx
    *
    * @return the sx
    */
   public java.lang.String getSx() {
      return _sx;
   }

   /**
    * Sets the sx
    *
    * @param sx the new sx value
    */
   public void setSx(java.lang.String sx) {
      _sx = sx;
   }
   /**
    * Returns the zt1
    *
    * @return the zt1
    */
   public java.lang.String getZt1() {
      return _zt1;
   }

   /**
    * Sets the zt1
    *
    * @param zt1 the new zt1 value
    */
   public void setZt1(java.lang.String zt1) {
      _zt1 = zt1;
   }
   /**
    * Returns the zt2
    *
    * @return the zt2
    */
   public java.lang.String getZt2() {
      return _zt2;
   }

   /**
    * Sets the zt2
    *
    * @param zt2 the new zt2 value
    */
   public void setZt2(java.lang.String zt2) {
      _zt2 = zt2;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getTzbh() == null) {
         errors.add("tzbh", new ActionError("error.tzbh.required"));
      }
      if(getTzbt() == null) {
         errors.add("tzbt", new ActionError("error.tzbt.required"));
      }
      if(getTzlxDm() == null) {
         errors.add("tzlxDm", new ActionError("error.tzlxDm.required"));
      }
      if(getDwbh() == null) {
         errors.add("dwbh", new ActionError("error.dwbh.required"));
      }
      if(getBjrq() == null) {
         errors.add("bjrq", new ActionError("error.bjrq.required"));
      }
      if(getXtzBz() == null) {
         errors.add("xtzBz", new ActionError("error.xtzBz.required"));
      }
      if(getJjtzBz() == null) {
         errors.add("jjtzBz", new ActionError("error.jjtzBz.required"));
      }
      // TODO test format/data
      return errors;
   }
}
